package com.mxsat.system.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mxsat.common.dao.DaoImpl;
import com.mxsat.system.dao.SysMenuDao;
import com.mxsat.system.entity.SysMenu;

@Repository
public class SysMenuDaoImpl extends DaoImpl<BaseMapper<SysMenu>, SysMenu> implements SysMenuDao {

	@Override
	public IPage<SysMenu> selectMenuByPage(IPage<SysMenu> page, Map<String, Object> condition) throws Exception {
		QueryWrapper<SysMenu> queryWrapper = new QueryWrapper<>();
		queryWrapper.allEq(condition);
		return this.page(page, queryWrapper);
	}

	@Override
	public List<SysMenu> selectMenuByAll() throws Exception {
		return this.list(new QueryWrapper<SysMenu>().eq("data_status", "N"));
	}

}
